//
//  PublishListViewController.m
//  WuShiCity
//
//  Created by chengjie on 16/7/4.
//  Copyright © 2016年 chengjie. All rights reserved.
//

#import "PublishListViewController.h"
#import "PublishListTableViewCell.h"

@interface PublishListViewController ()<UITableViewDataSource,UITableViewDelegate>;
@property (nonatomic, strong) UITableView *tableView;

@end

@implementation PublishListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.view addSubview:self.tableView];
    // Do any additional setup after loading the view.
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    PublishListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PublishListCell" forIndexPath:indexPath];
    cell.listName.text = @"123456789";
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 70;
}


#pragma mark - -------laying--------
- (UITableView *)tableView {
    
    if (!_tableView) {
        
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
        [_tableView registerNib:[UINib nibWithNibName:@"PublishListTableViewCell" bundle:nil] forCellReuseIdentifier:@"PublishListCell"];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.delegate = self;
        _tableView.dataSource = self;
    }
    return _tableView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
